package Test;



import net.sf.json.JSONObject;

import org.junit.BeforeClass;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import service.LoginService;
import vo.Address;
import vo.Store;

public class RegisterTest {
	@Autowired(required=true)
	private static LoginService ls;
	
	
	@BeforeClass
	public static void beforeClass(){
		ApplicationContext context=new ClassPathXmlApplicationContext("applicationContext.xml");
		ls=(LoginService) context.getBean("ls");
		//sd=(StuDao)context.getBean("sd");
	}
	//商家注册信息，并向管理员发送消息，申请提交
	@Test
	public void sendRegister(){
		Store sp=new Store();
		Address address=new Address();
		address.setProvince("eerw");
		address.setCity("eewv");
		address.setStreet("efrvw");
		
		sp.setSellerName("2");
		sp.setMobile("4");
		sp.setTele("23");
		sp.setEmail("413");
		sp.setQq("qq12");
		sp.setType("e53");
		sp.setPassword("eer");
		sp.setShopName("eervw");
		sp.setAddress(address);
		sp.setDetails("evaew");
		sp.setStatus(0);
		sp.setComplainNum(1);
//		JSONObject spJson=JSONObject.fromObject(sp);
//		System.out.println(spJson.toString());
		System.out.println(ls.regist(sp));
	}
/*	//商家进行登录验证
	@Test
	public void sendLogin(){
		String mobile="3";
		String password="er";
		Store store=null;
		store=ls.login(mobile, password);
		System.out.println(store.getMobile());
	}*/
	

}
